window open same tab

85

window open same tab -

window.open("https://www.youraddress.com","_self")

open window in same tab -

const editWindowUrl = <yourUrl>
cy.window().then((win) => {
const stub = cy.stub(win, "open").as("windowOpen");
});
cy.contains("Edit").click();
cy.get("@windowOpen").should("be.called");
cy.window().then((win) => {
win.location.href = editWindowUrl;
});

Comments

Submit
0 Comments